home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 1.5)
-
- *
- print '1. Parser'
- print '1.1 Tokens'
- print '1.1.1 Backslashes'
- x = 1 + 1
- if x != 2:
- raise TestFailed, 'backslash for line continuation'
-
- x = 0
- if x != 0:
- raise TestFailed, 'backslash ending comment'
-
- print '1.1.2 Numeric literals'
- print '1.1.2.1 Plain integers'
- if 255 != 255:
- raise TestFailed, 'hex int'
-
- if 255 != 255:
- raise TestFailed, 'octal int'
-
- if 2147483647 != 2147483647:
- raise TestFailed, 'large positive int'
-
-
- try:
- maxint
- except ImportError:
- maxint = 2147483647
-
- if maxint == 2147483647:
- if -2147483647 - 1 != -2147483648:
- raise TestFailed, 'max negative int'
-
- if -1 != -1:
- raise TestFailed, 'oct -1'
-
- if -1 != -1:
- raise TestFailed, 'hex -1'
-
- for s in ('2147483648', '040000000000', '0x100000000'):
-
- try:
- x = eval(s)
- except OverflowError:
- 0
- 0
- ('2147483648', '040000000000', '0x100000000')
- continue
- except:
- 0
-
- print 'No OverflowError on huge integer literal ' + `s`
-
- elif eval('maxint == 9223372036854775807'):
- if eval('-9223372036854775807-1 != 01000000000000000000000'):
- raise TestFailed, 'max negative int'
-
- if eval('01777777777777777777777') != -1:
- raise TestFailed, 'oct -1'
-
- if eval('0xffffffffffffffff') != -1:
- raise TestFailed, 'hex -1'
-
- for s in ('9223372036854775808', '02000000000000000000000', '0x10000000000000000'):
-
- try:
- x = eval(s)
- except OverflowError:
- 0
- 0
- ('9223372036854775808', '02000000000000000000000', '0x10000000000000000')
- continue
- except:
- 0
-
- raise TestFailed, 'No OverflowError on huge integer literal ' + `s`
-
- else:
- print 'Weird maxint value', maxint
- print '1.1.2.2 Long integers'
- x = 0x0L
- x = 0x0L
- x = 0xFFFFFFFFFFFFFFFFL
- x = 0xFFFFFFFFFFFFFFFFL
- x = 0x7FFFFFFFFFFFFL
- x = 0x7FFFFFFFFFFFFL
- x = 0x18EE90FF6C373E0EE4E3F0AD2L
- x = 0x18EE90FF6C373E0EE4E3F0AD2L
- print '1.1.2.3 Floating point'
- x = 3.14
- x = 314.0
- x = 0.314
- x = 0.314
- x = 3e+14
- x = 3e+14
- x = 3e-14
- x = 3e+14
- x = 3e+14
- x = 3e+13
- x = 31000.0
- print '1.1.3 String literals'
- x = ''
- y = ''
- if __debug__:
- if not len(x) == 0 and x == y:
- raise AssertionError
- x = "'"
- y = "'"
- if __debug__:
- if not len(x) == 1 and x == y and ord(x) == 39:
- raise AssertionError
- x = '"'
- y = '"'
- if __debug__:
- if not len(x) == 1 and x == y and ord(x) == 34:
- raise AssertionError
- x = 'doesn\'t "shrink" does it'
- y = 'doesn\'t "shrink" does it'
- if __debug__:
- if not len(x) == 24 and x == y:
- raise AssertionError
- x = 'does "shrink" doesn\'t it'
- y = 'does "shrink" doesn\'t it'
- if __debug__:
- if not len(x) == 24 and x == y:
- raise AssertionError
- x = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
- y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
- if not __debug__ and x == y:
- raise AssertionError
- y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
- if not __debug__ and x == y:
- raise AssertionError
- y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
- if not __debug__ and x == y:
- raise AssertionError
- y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
- if not __debug__ and x == y:
- raise AssertionError
- print '1.2 Grammar'
- print 'single_input'
- print 'file_input'
- print 'expr_input'
- print 'eval_input'
- x = eval('1, 0 or 1')
- print 'funcdef'
-
- def f1():
- pass
-
-
- def f2(one_argument):
- pass
-
-
- def f3(two, arguments):
- pass
-
-
- def f4(two, .2):
- (argument, list) = (compound,)
-
-
- def a1(one_arg):
- pass
-
-
- def a2(two, args):
- pass
-
-
- def v0(*rest):
- pass
-
-
- def v1(a, *rest):
- pass
-
-
- def v2(a, b, *rest):
- pass
-
-
- def v3(a, .2, *rest):
- (b, c) = .2
-
-
- def d01(a = 1):
- pass
-
- d01()
- d01(1)
-
- def d11(a, b = 1):
- pass
-
- d11(1)
- d11(1, 2)
-
- def d21(a, b, c = 1):
- pass
-
- d21(1, 2)
- d21(1, 2, 3)
-
- def d02(a = 1, b = 2):
- pass
-
- d02()
- d02(1)
- d02(1, 2)
-
- def d12(a, b = 1, c = 2):
- pass
-
- d12(1)
- d12(1, 2)
- d12(1, 2, 3)
-
- def d22(a, b, c = 1, d = 2):
- pass
-
- d22(1, 2)
- d22(1, 2, 3)
- d22(1, 2, 3, 4)
-
- def d01v(a = 1, *rest):
- pass
-
- d01v()
- d01v(1)
- d01v(1, 2)
-
- def d11v(a, b = 1, *rest):
- pass
-
- d11v(1)
- d11v(1, 2)
- d11v(1, 2, 3)
-
- def d21v(a, b, c = 1, *rest):
- pass
-
- d21v(1, 2)
- d21v(1, 2, 3)
- d21v(1, 2, 3, 4)
-
- def d02v(a = 1, b = 2, *rest):
- pass
-
- d02v()
- d02v(1)
- d02v(1, 2)
- d02v(1, 2, 3)
-
- def d12v(a, b = 1, c = 2, *rest):
- pass
-
- d12v(1)
- d12v(1, 2)
- d12v(1, 2, 3)
- d12v(1, 2, 3, 4)
-
- def d22v(a, b, c = 1, d = 2, *rest):
- pass
-
- d22v(1, 2)
- d22v(1, 2, 3)
- d22v(1, 2, 3, 4)
- d22v(1, 2, 3, 4, 5)
- print 'simple_stmt'
- x = 1
- del x
- print 'expr_stmt'
- 1
- (1, 2, 3)
- x = 1
- x = (1, 2, 3)
- x = y = z = (1, 2, 3)
- (x, y, z) = (1, 2, 3)
- abc = (a, b, c) = (x, y, z) = xyz = (1, 2, (3, 4))
- print 'print_stmt'
- print 1, 2, 3
- print 1, 2, 3
- if not 0:
- pass
- print 1,
- if not 0:
- pass
- print 1,
- if not 0:
- pass
- print 1
- print 'del_stmt'
- del abc
- del x
- del y
- del z
- del xyz
- print 'pass_stmt'
- print 'flow_stmt'
- print 'break_stmt'
- while 1:
- break
- print 'continue_stmt'
- i = 1
- while i:
- i = 0
- continue
- print 'return_stmt'
-
- def g1():
- return None
-
-
- def g2():
- return 1
-
- g1()
- x = g2()
- print 'raise_stmt'
-
- try:
- raise RuntimeError, 'just testing'
- except RuntimeError:
- pass
-
-
- try:
- raise KeyboardInterrupt
- except KeyboardInterrupt:
- pass
-
- print 'import_stmt'
- import sys
- import time
- import sys
- time
- *
- argv
- print 'global_stmt'
- print 'exec_stmt'
- f()
- exec 'z = 1' in g
- if g != {
- 'z': 1 }:
- raise TestFailed, "exec 'z = 1' in g"
-
- g = { }
- l = { }
- exec 'global a; a = 1; b = 2' in g, l
- if g.has_key('__builtins__'):
- del g['__builtins__']
-
- if l.has_key('__builtins__'):
- del l['__builtins__']
-
- if (g, l) != ({
- 'a': 1 }, {
- 'b': 2 }):
- raise TestFailed, 'exec ... in g, l'
-
- print 'if_stmt'
- if 1:
- pass
-
- if 1:
- pass
-
- print 'while_stmt'
- while 0:
- pass
- while 0:
- pass
- print 'for_stmt'
- for i in (1, 2, 3):
- pass
-
- for i, j, k in ():
- pass
-
-
- class Squares:
-
- def __init__(self, max):
- self.max = max
- self.sofar = []
-
-
- def __len__(self):
- return len(self.sofar)
-
-
- def __getitem__(self, i):
- if not None if i <= i else i < self.max:
- raise IndexError
-
- n = len(self.sofar)
- while n <= i:
- self.sofar.append(n * n)
- n = n + 1
- return self.sofar[i]
-
-
- n = 0
- for x in Squares(10):
- n = n + x
-
- print 'try_stmt'
-
- try:
- 1 / 0
- except ZeroDivisionError:
- ()
- ()
- 0
- except:
- (1, 2, 3)
-
-
- try:
- 1 / 0
- except EOFError:
- (1, 2, 3)
- (1, 2, 3)
- except TypeError:
- msg = None
- except RuntimeError:
- msg = None
- except:
- (1, 2, 3)
-
-
- try:
- 1 / 0
- except (EOFError, TypeError, ZeroDivisionError):
- (1, 2, 3)
- (1, 2, 3)
- except:
- (1, 2, 3)
-
-
- try:
- 1 / 0
- except (EOFError, TypeError, ZeroDivisionError):
- (1, 2, 3)
- msg = (1, 2, 3)
- except:
- (1, 2, 3)
-
-
- try:
- pass
- finally:
- pass
-
- print 'suite'
- if 1:
- pass
-
- if 1:
- pass
-
- if 1:
- pass
-
- print 'test'
- if not 1:
- pass
-
- if 1 and 1:
- pass
-
- if 1 or 1:
- pass
-
- if not (not (not 1)):
- pass
-
- if not 1 and 1 and 1:
- pass
-
- if not 1 and 1:
- if 1 and 1 and 1 and not 1 and 1:
- pass
-
- print 'comparison'
- if 1:
- pass
-
- x = 1 == 1
- if 1 == 1:
- pass
-
- if 1 != 1:
- pass
-
- if 1 != 1:
- pass
-
- if 1 < 1:
- pass
-
- if 1 > 1:
- pass
-
- if 1 <= 1:
- pass
-
- if 1 >= 1:
- pass
-
- if 1 is 1:
- pass
-
- if 1 is not 1:
- pass
-
- if 1 in ():
- pass
-
- if 1 not in ():
- pass
-
- if 1 < 1 and 1 > 1 and 1 == 1 and 1 >= 1 and 1 <= 1 and 1 != 1 and 1 != 1 and 1 in 1 and 1 not in 1 and 1 is 1:
- pass
- elif 1 is not 1:
- pass
-
- print 'binary mask ops'
- x = 1 & 1
- x = 1 ^ 1
- x = 1 | 1
- print 'shift ops'
- x = 1 << 1
- x = 1 >> 1
- x = 1 << 1 >> 1
- print 'additive ops'
- x = 1
- x = 1 + 1
- x = 1 - 1 - 1
- x = ((1 - 1) + 1 - 1) + 1
- print 'multiplicative ops'
- x = 1 * 1
- x = 1 / 1
- x = 1 % 1
- x = (1 / 1) * 1 % 1
- print 'unary ops'
- x = +1
- x = -1
- x = ~1
- x = ~1 ^ 1 & 1 | 1 & 1 ^ -1
- x = -1 * 1 / 1 + 1 * 1 - ---1 * 1
- print 'selectors'
- f1()
- f2(1)
- f2(1)
- f3(1, 2)
- f3(1, 2)
- f4(1, (2, (3, 4)))
- v0()
- v0(1)
- v0(1)
- v0(1, 2)
- v0(1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
- v1(1)
- v1(1)
- v1(1, 2)
- v1(1, 2, 3)
- v1(1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
- v2(1, 2)
- v2(1, 2, 3)
- v2(1, 2, 3, 4)
- v2(1, 2, 3, 4, 5, 6, 7, 8, 9, 0)
- v3(1, (2, 3))
- v3(1, (2, 3), 4)
- v3(1, (2, 3), 4, 5, 6, 7, 8, 9, 0)
- import sys
- import time
- c = sys.path[0]
- x = time.time()
- x = sys.modules['time'].time()
- a = '01234'
- c = a[0]
- c = a[-1]
- s = a[0:5]
- s = a[:5]
- s = a[0:]
- s = a[:]
- s = a[-5:]
- s = a[:-1]
- s = a[-4:-3]
- print 'atoms'
- x = 1
- if not 1 and 2:
- pass
- x = 3
- if not 1 and 2:
- pass
- x = (3, 2, 3)
- x = []
- x = [
- 1]
- if not 1 and 2:
- pass
- x = [
- 3]
- if not 1 and 2:
- pass
- x = [
- 3,
- 2,
- 3]
- x = []
- x = { }
- x = {
- 'one': 1 }
- x = {
- 'one': 1 }
- if not 1:
- pass
- if not 'one':
- pass
- x = {
- 'two': 2 }
- x = {
- 'one': 1,
- 'two': 2 }
- x = {
- 'one': 1,
- 'two': 2 }
- x = {
- 'one': 1,
- 'two': 2,
- 'three': 3,
- 'four': 4,
- 'five': 5,
- 'six': 6 }
- x = `x`
- if not 1 and 2:
- pass
- x = `3`
- x = x
- x = 'x'
- x = 123
- print 'classdef'
-
- class B:
- pass
-
-
- class C1(B):
- pass
-
-
- class C2(B):
- pass
-
-
- class D(C1, C2, B):
- pass
-
-
- class C:
-
- def meth1(self):
- pass
-
-
- def meth2(self, arg):
- pass
-
-
- def meth3(self, a1, a2):
- pass
-
-
-